package com.example.agenda;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import com.example.agenda.presenter.EditContactPresenter;
import com.example.agenda.view.EditContactView;
import com.example.util.StaticUtil;

public class CadastroActivity extends Activity implements EditContactView {

	private EditContactPresenter editContactPresenter;

	public CadastroActivity() {
		editContactPresenter = new EditContactPresenter(this, this);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.cadastro);

		editContactPresenter.start();
	}

	@Override
	protected void onResume() {
		super.onStart();

		editContactPresenter.start();
	}

	public String getId() {
		Intent intent = getIntent();
		return intent.getStringExtra(StaticUtil.ID);
	}

	@Override
	protected void onNewIntent(Intent intent) {
		super.onNewIntent(intent);
		setIntent(intent);
	}
	
	public EditText getNomeText() {
		return (EditText) findViewById(R.id.txtPrimeiroNome);
	}

	public EditText getSegundoNomeText() {
		return (EditText) findViewById(R.id.txtSegundoNome);
	}

	public EditText getEmailText() {
		return (EditText) findViewById(R.id.txtEmail);
	}

	public Button getButtontSave() {
		return (Button) findViewById(R.id.btSave);
	}

	public Button getButtontCancel() {
		return (Button) findViewById(R.id.btCancelar);
	}
}